/*
 * InterfaceMain.java
 *
 * Created on 07/02/2011, 18:33:23
 */
package view;

import controller.AlunoDAO;
import controller.DisciplinaDAO;
import controller.Gravar;
import controller.MyTablePrintable;
import controller.NotasDAO;


import model.Aluno;
import model.Disciplina;
import model.Notas;

import java.awt.Color;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import java.rmi.server.ExportException;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.JTable.PrintMode;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author Adriano
 */
public class InterfaceMain extends javax.swing.JFrame {

    /** Creates new form InterfaceMain */
    public InterfaceMain() {
        initComponents();
    }

    private Disciplina disciplinaImpressao;
    private boolean teste = true;
    String codigoDisciplina;
    public void montarTabelaDeAlunos(ArrayList<Aluno> arrayList, JTable jTable) {
        int i = 0;
        int j = arrayList.size();
        while (i < j) {
            if (i > jTable.getRowCount() - 1) {
                DefaultTableModel modelo = new DefaultTableModel();
                modelo = (DefaultTableModel) jTable.getModel();
                modelo.addRow(new String[]{"", ""});
                jTable.setModel(modelo);
            }
            Aluno aluno = arrayList.get(i);
            jTable.setValueAt(aluno.getMatricula(), i, 0);
            jTable.setValueAt(aluno.getNome(), i, 1);
            i++;
        }
    }
    
    public void montarTabelaDeNotasDisciplina(ArrayList<Aluno> listaAlunos, Disciplina disciplina, JTable jTable, String semestre){
        NotasDAO notasDao = NotasDAO.getInstance();

        int j = listaAlunos.size();
        int i = 0;
        
        while (i < j) {
            if (i > jTable.getRowCount() - 1) {
                DefaultTableModel modelo = new DefaultTableModel();
                modelo = (DefaultTableModel) jTable.getModel();
                modelo.addRow(new String[]{"", "", "", "", "", ""});
                jTable.setModel(modelo);  }

       Aluno aluno      = listaAlunos.get(i);
       Notas notasAluno =  notasDao.ProcuraNota(aluno.getMatricula(),disciplina.getCodigo(), semestre);
       
       ArrayList<Double> listaNotas = new ArrayList<Double>(); 
       
       
       listaNotas = notasAluno.getNotas();
       
            
       
       int listaNotasT  = listaNotas.size();
       jTable.setValueAt(aluno.getMatricula(), i, 0);
       jTable.setValueAt(aluno.getNome(),i,1);

       if     (listaNotasT==0) for(int m = 0;m<3;m++)listaNotas.add(-1.0);
       else if(listaNotasT == 1) for(int m=0;m<2;m++)listaNotas.add(-1.0);
       else if(listaNotasT==2)   listaNotas.add(-1.0);
       
       if(listaNotas.get(0)==-1) jTable.setValueAt(" ",i,2);
            else jTable.setValueAt(listaNotas.get(0), i, 2);

       if(listaNotas.get(1) == -1)jTable.setValueAt((" "),i,3);
            else jTable.setValueAt(listaNotas.get(1),i,3);

       if(listaNotas.get(2) == -1)jTable.setValueAt(" ",i , 4);
            else jTable.setValueAt(listaNotas.get(2), i, 4);

       jTable.setValueAt(notasAluno.getStatus(),i,5);

       i++;
           
    }
    }

    public static void montaComboBoxDisciplina(ArrayList<Disciplina> arrayAux, JComboBox comboBox) {
        int j = arrayAux.size();

        for (int i = 0; i < j; i++) {
            String codigoDisciplina = arrayAux.get(i).getCodigo();
            String nomeDisciplina = arrayAux.get(i).getNome();
            comboBox.addItem(codigoDisciplina + " --- " + nomeDisciplina);
        }

    }

    public static void montaComboBoxAluno(ArrayList<Aluno> arrayAux, JComboBox comboBox) {
        int j = arrayAux.size();
        for (int i = 0; i < j; i++) {
            String matriculaAluno = arrayAux.get(i).getMatricula();
            String nomeAluno = arrayAux.get(i).getNome();
            comboBox.addItem(matriculaAluno + " --- " + nomeAluno);
        }
    }

    public static void montaComboBoxAluno(ArrayList<Aluno> arrayAux, JComboBox comboBox, JComboBox comboBox2) {
        int j = arrayAux.size();
        for (int i = 0; i < j; i++) {
            String matriculaAluno = arrayAux.get(i).getMatricula();
            String nomeAluno = arrayAux.get(i).getNome();
            comboBox.addItem(matriculaAluno + " --- " + nomeAluno);

            comboBox2.addItem(matriculaAluno + " --- " + nomeAluno);
        }
    }

    public static void montarComboBoxDisciplinaAluno(ArrayList<Disciplina> arrayAux, JComboBox comboBox) {
        int j = arrayAux.size();
        if (arrayAux.isEmpty()) {
            JOptionPane.showMessageDialog(null, "Aluno não matriculado", "WARNING", JOptionPane.INFORMATION_MESSAGE);
        } else {
            for (int i = 0; i < j; i++) {
                String codigoDisciplina = arrayAux.get(i).getCodigo();
                String nomeDisciplina   = arrayAux.get(i).getNome();
                comboBox.addItem(codigoDisciplina + " --- " + nomeDisciplina);
            }
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        botoesExcluir = new javax.swing.ButtonGroup();
        botoesListar = new javax.swing.ButtonGroup();
        jLabelListar = new javax.swing.JLabel();
        jLabelEstatisticas = new javax.swing.JLabel();
        jLabelExcluir = new javax.swing.JLabel();
        jLabelCadastrarAluno = new javax.swing.JLabel();
        jLabelInfoAluno = new javax.swing.JLabel();
        jLabelInfoSistema = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLayeredPane3 = new javax.swing.JLayeredPane();
        jPanelCadastrarDisciplina = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLabel46 = new javax.swing.JLabel();
        jPanelListar = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jRadioButton4 = new javax.swing.JRadioButton();
        jRadioButton5 = new javax.swing.JRadioButton();
        jComboBox3 = new javax.swing.JComboBox();
        jLabel24 = new javax.swing.JLabel();
        jLabelBotaoListar = new javax.swing.JLabel();
        jPanelCadastrarAluno = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jTextField5 = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jTextField6 = new javax.swing.JTextField();
        jLabelBotaoCadastrarAluno = new javax.swing.JLabel();
        jPanelVerAluno = new javax.swing.JPanel();
        jLabel14 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jComboBox5 = new javax.swing.JComboBox();
        jLabelBotaoVisualizarAluno = new javax.swing.JLabel();
        jPanelInfoSistema = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        jPanelEstatisticas = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jPanelExcluir = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jComboBox1 = new javax.swing.JComboBox();
        jRadioButton3 = new javax.swing.JRadioButton();
        jComboBox2 = new javax.swing.JComboBox();
        jComboBox4 = new javax.swing.JComboBox();
        jComboBox6 = new javax.swing.JComboBox();
        jLabelBotaoExcluir = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jPanelInicio = new javax.swing.JPanel();
        jLabel25 = new javax.swing.JLabel();
        jPanelTodosAlunos = new javax.swing.JPanel();
        jLabel26 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanelInfoAluno = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jTextField3 = new javax.swing.JTextField();
        jTextField4 = new javax.swing.JTextField();
        jLabel37 = new javax.swing.JLabel();
        jPanelMatricularAluno = new javax.swing.JPanel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jComboBox11 = new javax.swing.JComboBox();
        jComboBox10 = new javax.swing.JComboBox();
        jLabelBotaoMatricular = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jComboBox14 = new javax.swing.JComboBox();
        jPanelRegistrarNotas = new javax.swing.JPanel();
        jComboBox8 = new javax.swing.JComboBox();
        jComboBox9 = new javax.swing.JComboBox();
        jComboBox12 = new javax.swing.JComboBox();
        jComboBox13 = new javax.swing.JComboBox();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabelBotaoRegistrarNotas = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jComboBox15 = new javax.swing.JComboBox();
        jPanelAlunosDeUmaDisciplina = new javax.swing.JPanel();
        jLabel52 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        jLabel38 = new javax.swing.JLabel();
        jButtonSalvarRelatorioTxt = new javax.swing.JButton();
        jButtonImprimirRelatorioNotas = new javax.swing.JButton();
        jComboBox7 = new javax.swing.JComboBox();
        AtualizaSemestre = new javax.swing.JButton();
        jComboBox16 = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        topo = new javax.swing.JLabel();
        jLabelRegistrarNota = new javax.swing.JLabel();
        jLabelMatricular = new javax.swing.JLabel();
        jLabelCadastrarDisciplina = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();

        botoesExcluir.add(jRadioButton1);
        botoesExcluir.add(jRadioButton2);
        botoesExcluir.add(jRadioButton3);

        botoesListar.add(jRadioButton4);
        botoesListar.add(jRadioButton5);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        jLabelListar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/listarmenor.png"))); // NOI18N
        jLabelListar.setToolTipText("Listar alunos");
        jLabelListar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelListarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelListarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelListarMouseExited(evt);
            }
        });

        jLabelEstatisticas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/estatisticamenor.png"))); // NOI18N
        jLabelEstatisticas.setToolTipText("Estatísticas");
        jLabelEstatisticas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelEstatisticasMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelEstatisticasMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelEstatisticasMouseExited(evt);
            }
        });

        jLabelExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/excluirmenor.png"))); // NOI18N
        jLabelExcluir.setToolTipText("Excluir aluno ou disciplina");
        jLabelExcluir.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelExcluirMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelExcluirMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelExcluirMouseExited(evt);
            }
        });

        jLabelCadastrarAluno.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/addmenor.png"))); // NOI18N
        jLabelCadastrarAluno.setToolTipText("Adiconar Aluno ao sistema");
        jLabelCadastrarAluno.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelCadastrarAlunoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelCadastrarAlunoMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelCadastrarAlunoMouseExited(evt);
            }
        });

        jLabelInfoAluno.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/alunomenor.png"))); // NOI18N
        jLabelInfoAluno.setToolTipText("Obter informações sobre os alunos (nomes, disciplinas que estão cursando, notas...");
        jLabelInfoAluno.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelInfoAlunoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelInfoAlunoMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelInfoAlunoMouseExited(evt);
            }
        });

        jLabelInfoSistema.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/infomenor.png"))); // NOI18N
        jLabelInfoSistema.setToolTipText("Informações sobre o SADAF");
        jLabelInfoSistema.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelInfoSistemaMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelInfoSistemaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelInfoSistemaMouseExited(evt);
            }
        });

        jLabel8.setText("Cadastrar Disciplina");

        jLabel17.setText("Nome");

        jLabel18.setText("Código");

        jLabel46.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/bCadastrar.png"))); // NOI18N
        jLabel46.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel46MouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabel46MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabel46MouseExited(evt);
            }
        });

        javax.swing.GroupLayout jPanelCadastrarDisciplinaLayout = new javax.swing.GroupLayout(jPanelCadastrarDisciplina);
        jPanelCadastrarDisciplina.setLayout(jPanelCadastrarDisciplinaLayout);
        jPanelCadastrarDisciplinaLayout.setHorizontalGroup(
            jPanelCadastrarDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCadastrarDisciplinaLayout.createSequentialGroup()
                .addGroup(jPanelCadastrarDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelCadastrarDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanelCadastrarDisciplinaLayout.createSequentialGroup()
                            .addComponent(jLabel17)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 598, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanelCadastrarDisciplinaLayout.createSequentialGroup()
                            .addComponent(jLabel18)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextField2)))
                    .addComponent(jLabel46))
                .addContainerGap(355, Short.MAX_VALUE))
        );
        jPanelCadastrarDisciplinaLayout.setVerticalGroup(
            jPanelCadastrarDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCadastrarDisciplinaLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jLabel8)
                .addGap(18, 18, 18)
                .addGroup(jPanelCadastrarDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanelCadastrarDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29)
                .addComponent(jLabel46)
                .addContainerGap(268, Short.MAX_VALUE))
        );

        jPanelCadastrarDisciplina.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelCadastrarDisciplina, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel12.setText("Listar Alunos");

        jRadioButton4.setText("Todos os alunos");
        jRadioButton4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jRadioButton4MouseClicked(evt);
            }
        });
        jRadioButton4.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRadioButton4ItemStateChanged(evt);
            }
        });

        jRadioButton5.setText("Alunos de uma disciplina");
        jRadioButton5.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRadioButton5ItemStateChanged(evt);
            }
        });

        jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox3.setEnabled(false);
        jComboBox3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox3ActionPerformed(evt);
            }
        });

        jLabel24.setText("Disciplina");

        jLabelBotaoListar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/bListar.png"))); // NOI18N
        jLabelBotaoListar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelBotaoListarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelBotaoListarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelBotaoListarMouseExited(evt);
            }
        });

        javax.swing.GroupLayout jPanelListarLayout = new javax.swing.GroupLayout(jPanelListar);
        jPanelListar.setLayout(jPanelListarLayout);
        jPanelListarLayout.setHorizontalGroup(
            jPanelListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelListarLayout.createSequentialGroup()
                .addGroup(jPanelListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel12)
                    .addComponent(jRadioButton4)
                    .addComponent(jRadioButton5)
                    .addGroup(jPanelListarLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(jLabel24)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabelBotaoListar))
                .addContainerGap(717, Short.MAX_VALUE))
        );
        jPanelListarLayout.setVerticalGroup(
            jPanelListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelListarLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jLabel12)
                .addGap(28, 28, 28)
                .addComponent(jRadioButton4)
                .addGap(30, 30, 30)
                .addComponent(jRadioButton5)
                .addGap(3, 3, 3)
                .addGroup(jPanelListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(46, 46, 46)
                .addComponent(jLabelBotaoListar)
                .addContainerGap(215, Short.MAX_VALUE))
        );

        jPanelListar.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelListar, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel13.setText("Adicionar Aluno ao sistema");

        jLabel21.setText("Matrícula");

        jLabel22.setText("Nome");

        jLabelBotaoCadastrarAluno.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/bAdd.png"))); // NOI18N
        jLabelBotaoCadastrarAluno.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelBotaoCadastrarAlunoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelBotaoCadastrarAlunoMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelBotaoCadastrarAlunoMouseExited(evt);
            }
        });

        javax.swing.GroupLayout jPanelCadastrarAlunoLayout = new javax.swing.GroupLayout(jPanelCadastrarAluno);
        jPanelCadastrarAluno.setLayout(jPanelCadastrarAlunoLayout);
        jPanelCadastrarAlunoLayout.setHorizontalGroup(
            jPanelCadastrarAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCadastrarAlunoLayout.createSequentialGroup()
                .addGroup(jPanelCadastrarAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelCadastrarAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jLabel13)
                        .addGroup(jPanelCadastrarAlunoLayout.createSequentialGroup()
                            .addGroup(jPanelCadastrarAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel21)
                                .addComponent(jLabel22))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanelCadastrarAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 598, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jTextField5))))
                    .addComponent(jLabelBotaoCadastrarAluno))
                .addContainerGap(345, Short.MAX_VALUE))
        );
        jPanelCadastrarAlunoLayout.setVerticalGroup(
            jPanelCadastrarAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCadastrarAlunoLayout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(jLabel13)
                .addGap(18, 18, 18)
                .addGroup(jPanelCadastrarAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanelCadastrarAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(35, 35, 35)
                .addComponent(jLabelBotaoCadastrarAluno)
                .addContainerGap(263, Short.MAX_VALUE))
        );

        jPanelCadastrarAluno.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelCadastrarAluno, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel14.setText("Obter informações sobre um aluno");

        jLabel23.setText("Aluno");

        jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox5.setOpaque(false);
        jComboBox5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox5ActionPerformed(evt);
            }
        });

        jLabelBotaoVisualizarAluno.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/bVisualizar.png"))); // NOI18N
        jLabelBotaoVisualizarAluno.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelBotaoVisualizarAlunoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelBotaoVisualizarAlunoMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelBotaoVisualizarAlunoMouseExited(evt);
            }
        });

        javax.swing.GroupLayout jPanelVerAlunoLayout = new javax.swing.GroupLayout(jPanelVerAluno);
        jPanelVerAluno.setLayout(jPanelVerAlunoLayout);
        jPanelVerAlunoLayout.setHorizontalGroup(
            jPanelVerAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelVerAlunoLayout.createSequentialGroup()
                .addGroup(jPanelVerAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14)
                    .addGroup(jPanelVerAlunoLayout.createSequentialGroup()
                        .addComponent(jLabel23)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabelBotaoVisualizarAluno))
                .addContainerGap(548, Short.MAX_VALUE))
        );
        jPanelVerAlunoLayout.setVerticalGroup(
            jPanelVerAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelVerAlunoLayout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addComponent(jLabel14)
                .addGap(32, 32, 32)
                .addGroup(jPanelVerAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(43, 43, 43)
                .addComponent(jLabelBotaoVisualizarAluno)
                .addContainerGap(283, Short.MAX_VALUE))
        );

        jPanelVerAluno.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelVerAluno, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel15.setText("Sistema desenvolvido para o acompanhamento dos alunos feras do Bacharelado em Ciência da Computação da UFPB.");

        javax.swing.GroupLayout jPanelInfoSistemaLayout = new javax.swing.GroupLayout(jPanelInfoSistema);
        jPanelInfoSistema.setLayout(jPanelInfoSistemaLayout);
        jPanelInfoSistemaLayout.setHorizontalGroup(
            jPanelInfoSistemaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelInfoSistemaLayout.createSequentialGroup()
                .addGap(143, 143, 143)
                .addComponent(jLabel15)
                .addContainerGap(284, Short.MAX_VALUE))
        );
        jPanelInfoSistemaLayout.setVerticalGroup(
            jPanelInfoSistemaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelInfoSistemaLayout.createSequentialGroup()
                .addGap(150, 150, 150)
                .addComponent(jLabel15)
                .addContainerGap(286, Short.MAX_VALUE))
        );

        jPanelInfoSistema.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelInfoSistema, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel16.setText("Estatistica");

        javax.swing.GroupLayout jPanelEstatisticasLayout = new javax.swing.GroupLayout(jPanelEstatisticas);
        jPanelEstatisticas.setLayout(jPanelEstatisticasLayout);
        jPanelEstatisticasLayout.setHorizontalGroup(
            jPanelEstatisticasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelEstatisticasLayout.createSequentialGroup()
                .addGap(143, 143, 143)
                .addComponent(jLabel16)
                .addContainerGap(798, Short.MAX_VALUE))
        );
        jPanelEstatisticasLayout.setVerticalGroup(
            jPanelEstatisticasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelEstatisticasLayout.createSequentialGroup()
                .addGap(150, 150, 150)
                .addComponent(jLabel16)
                .addContainerGap(286, Short.MAX_VALUE))
        );

        jPanelEstatisticas.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelEstatisticas, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel9.setText("Excluir");

        jLabel10.setText("Aluno");

        jRadioButton1.setSelected(true);
        jRadioButton1.setText("Excluir aluno do sistema");
        jRadioButton1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRadioButton1ItemStateChanged(evt);
            }
        });

        jRadioButton2.setText("Excluir aluno de disciplina");
        jRadioButton2.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRadioButton2ItemStateChanged(evt);
            }
        });
        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton2ActionPerformed(evt);
            }
        });

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox1.setEnabled(false);
        jComboBox1.setOpaque(false);
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jRadioButton3.setText("Excluir Disciplina");
        jRadioButton3.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jRadioButton3ItemStateChanged(evt);
            }
        });

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox2.setEnabled(false);
        jComboBox2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox2ActionPerformed(evt);
            }
        });

        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox4ActionPerformed(evt);
            }
        });

        jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox6.setEnabled(false);
        jComboBox6.setOpaque(false);
        jComboBox6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox6ActionPerformed(evt);
            }
        });

        jLabelBotaoExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/bExcluir.png"))); // NOI18N
        jLabelBotaoExcluir.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelBotaoExcluirMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelBotaoExcluirMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelBotaoExcluirMouseExited(evt);
            }
        });

        jLabel11.setText("Aluno");

        jLabel19.setText("Disciplina");

        jLabel20.setText("Disciplina");

        javax.swing.GroupLayout jPanelExcluirLayout = new javax.swing.GroupLayout(jPanelExcluir);
        jPanelExcluir.setLayout(jPanelExcluirLayout);
        jPanelExcluirLayout.setHorizontalGroup(
            jPanelExcluirLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelExcluirLayout.createSequentialGroup()
                .addGroup(jPanelExcluirLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jRadioButton1)
                    .addComponent(jRadioButton2)
                    .addGroup(jPanelExcluirLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelBotaoExcluir))
                    .addGroup(jPanelExcluirLayout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addGroup(jPanelExcluirLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanelExcluirLayout.createSequentialGroup()
                                .addComponent(jLabel11)
                                .addGap(18, 18, 18)
                                .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanelExcluirLayout.createSequentialGroup()
                                .addComponent(jLabel10)
                                .addGap(18, 18, 18)
                                .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanelExcluirLayout.createSequentialGroup()
                                .addComponent(jLabel19)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanelExcluirLayout.createSequentialGroup()
                                .addComponent(jLabel20)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(jRadioButton3))
                .addContainerGap(510, Short.MAX_VALUE))
        );
        jPanelExcluirLayout.setVerticalGroup(
            jPanelExcluirLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelExcluirLayout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(jLabel9)
                .addGap(18, 18, 18)
                .addComponent(jRadioButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelExcluirLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addGap(36, 36, 36)
                .addComponent(jRadioButton2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelExcluirLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addGap(18, 18, 18)
                .addGroup(jPanelExcluirLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19))
                .addGap(18, 18, 18)
                .addComponent(jRadioButton3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelExcluirLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 81, Short.MAX_VALUE)
                .addComponent(jLabelBotaoExcluir)
                .addGap(40, 40, 40))
        );

        jPanelExcluir.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelExcluir, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel25.setText("Inicio");

        javax.swing.GroupLayout jPanelInicioLayout = new javax.swing.GroupLayout(jPanelInicio);
        jPanelInicio.setLayout(jPanelInicioLayout);
        jPanelInicioLayout.setHorizontalGroup(
            jPanelInicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelInicioLayout.createSequentialGroup()
                .addGap(143, 143, 143)
                .addComponent(jLabel25)
                .addContainerGap(812, Short.MAX_VALUE))
        );
        jPanelInicioLayout.setVerticalGroup(
            jPanelInicioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelInicioLayout.createSequentialGroup()
                .addGap(150, 150, 150)
                .addComponent(jLabel25)
                .addContainerGap(286, Short.MAX_VALUE))
        );

        jPanelInicio.setBounds(0, -10, 980, 450);
        jLayeredPane3.add(jPanelInicio, javax.swing.JLayeredPane.DRAG_LAYER);

        jLabel26.setText("Alunos cadastrados no sistema");

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Matrícula", "Nome"
            }
        ));
        jTable1.setEnabled(false);
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout jPanelTodosAlunosLayout = new javax.swing.GroupLayout(jPanelTodosAlunos);
        jPanelTodosAlunos.setLayout(jPanelTodosAlunosLayout);
        jPanelTodosAlunosLayout.setHorizontalGroup(
            jPanelTodosAlunosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTodosAlunosLayout.createSequentialGroup()
                .addGroup(jPanelTodosAlunosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel26)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 654, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(336, Short.MAX_VALUE))
        );
        jPanelTodosAlunosLayout.setVerticalGroup(
            jPanelTodosAlunosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTodosAlunosLayout.createSequentialGroup()
                .addGap(79, 79, 79)
                .addComponent(jLabel26)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(167, Short.MAX_VALUE))
        );

        jPanelTodosAlunos.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelTodosAlunos, javax.swing.JLayeredPane.DRAG_LAYER);

        jLabel27.setText("Dados sobre o aluno");

        jLabel28.setText("Nome");

        jLabel29.setText("Matrícula");

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null}
            },
            new String [] {
                "Disciplina", "Nota 1", "Nota 2", "Nota 3", "Final", "Média", "Situação"
            }
        ));
        jTable2.setEnabled(false);
        jScrollPane2.setViewportView(jTable2);

        jTextField3.setEditable(false);

        jTextField4.setEditable(false);

        jLabel37.setText("Disciplinas cursadas pelo aluno");

        javax.swing.GroupLayout jPanelInfoAlunoLayout = new javax.swing.GroupLayout(jPanelInfoAluno);
        jPanelInfoAluno.setLayout(jPanelInfoAlunoLayout);
        jPanelInfoAlunoLayout.setHorizontalGroup(
            jPanelInfoAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelInfoAlunoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelInfoAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelInfoAlunoLayout.createSequentialGroup()
                        .addComponent(jLabel28)
                        .addGap(34, 34, 34)
                        .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelInfoAlunoLayout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addGap(18, 18, 18)
                        .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel37, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 907, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(73, Short.MAX_VALUE))
        );
        jPanelInfoAlunoLayout.setVerticalGroup(
            jPanelInfoAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelInfoAlunoLayout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jLabel27)
                .addGap(18, 18, 18)
                .addGroup(jPanelInfoAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(jPanelInfoAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(44, 44, 44)
                .addComponent(jLabel37)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(167, Short.MAX_VALUE))
        );

        jPanelInfoAluno.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelInfoAluno, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel31.setText("Matricular Auno em Disciplina");

        jLabel32.setText("Aluno");

        jLabel33.setText("Disciplina");

        jLabelBotaoMatricular.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/bMatricular.png"))); // NOI18N
        jLabelBotaoMatricular.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelBotaoMatricularMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelBotaoMatricularMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelBotaoMatricularMouseExited(evt);
            }
        });

        jLabel36.setText("Semestre");

        javax.swing.GroupLayout jPanelMatricularAlunoLayout = new javax.swing.GroupLayout(jPanelMatricularAluno);
        jPanelMatricularAluno.setLayout(jPanelMatricularAlunoLayout);
        jPanelMatricularAlunoLayout.setHorizontalGroup(
            jPanelMatricularAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMatricularAlunoLayout.createSequentialGroup()
                .addGroup(jPanelMatricularAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelMatricularAlunoLayout.createSequentialGroup()
                        .addGroup(jPanelMatricularAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel32)
                            .addComponent(jLabel33))
                        .addGap(18, 18, 18)
                        .addGroup(jPanelMatricularAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jComboBox11, javax.swing.GroupLayout.PREFERRED_SIZE, 269, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jComboBox10, javax.swing.GroupLayout.PREFERRED_SIZE, 269, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelBotaoMatricular)
                    .addGroup(jPanelMatricularAlunoLayout.createSequentialGroup()
                        .addComponent(jLabel36)
                        .addGap(18, 18, 18)
                        .addComponent(jComboBox14, javax.swing.GroupLayout.PREFERRED_SIZE, 269, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(658, Short.MAX_VALUE))
        );
        jPanelMatricularAlunoLayout.setVerticalGroup(
            jPanelMatricularAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMatricularAlunoLayout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jLabel31)
                .addGap(20, 20, 20)
                .addGroup(jPanelMatricularAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel32)
                    .addComponent(jComboBox10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanelMatricularAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel33)
                    .addComponent(jComboBox11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanelMatricularAlunoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel36)
                    .addComponent(jComboBox14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(49, 49, 49)
                .addComponent(jLabelBotaoMatricular, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(206, 206, 206))
        );

        jPanelMatricularAluno.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelMatricularAluno, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox8ActionPerformed(evt);
            }
        });

        jComboBox9.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jComboBox9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox9ActionPerformed(evt);
            }
        });

        jComboBox12.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jComboBox13.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel39.setText("Aluno:");

        jLabel40.setText("Disciplina: ");

        jLabel41.setText("Nota: ");

        jLabel42.setText("Valor: ");

        jLabel43.setText("Situação: ");

        jLabel44.setText("-                                                                        -");

        jLabel34.setText("Registrar notas");

        jLabelBotaoRegistrarNotas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/bRegistrar.png"))); // NOI18N
        jLabelBotaoRegistrarNotas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelBotaoRegistrarNotasMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelBotaoRegistrarNotasMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelBotaoRegistrarNotasMouseExited(evt);
            }
        });

        jLabel47.setText("Semestre");

        jComboBox15.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout jPanelRegistrarNotasLayout = new javax.swing.GroupLayout(jPanelRegistrarNotas);
        jPanelRegistrarNotas.setLayout(jPanelRegistrarNotasLayout);
        jPanelRegistrarNotasLayout.setHorizontalGroup(
            jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRegistrarNotasLayout.createSequentialGroup()
                .addGap(162, 162, 162)
                .addComponent(jLabel43)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel44, javax.swing.GroupLayout.PREFERRED_SIZE, 419, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(355, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelRegistrarNotasLayout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel34, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelRegistrarNotasLayout.createSequentialGroup()
                        .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel41)
                            .addComponent(jLabel39)
                            .addComponent(jLabel47))
                        .addGap(27, 27, 27)
                        .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jComboBox15, 0, 233, Short.MAX_VALUE)
                            .addComponent(jComboBox12, javax.swing.GroupLayout.Alignment.LEADING, 0, 233, Short.MAX_VALUE)
                            .addComponent(jComboBox8, javax.swing.GroupLayout.Alignment.LEADING, 0, 233, Short.MAX_VALUE))))
                .addGap(223, 223, 223)
                .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel40)
                    .addComponent(jLabel42))
                .addGap(18, 18, 18)
                .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jComboBox13, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jComboBox9, 0, 254, Short.MAX_VALUE))
                .addGap(112, 112, 112))
            .addGroup(jPanelRegistrarNotasLayout.createSequentialGroup()
                .addGap(384, 384, 384)
                .addComponent(jLabelBotaoRegistrarNotas)
                .addContainerGap(480, Short.MAX_VALUE))
        );
        jPanelRegistrarNotasLayout.setVerticalGroup(
            jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelRegistrarNotasLayout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addComponent(jLabel34)
                .addGap(54, 54, 54)
                .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel39)
                    .addComponent(jComboBox8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel40)
                    .addComponent(jComboBox9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(38, 38, 38)
                .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel41)
                    .addComponent(jLabel42))
                .addGap(29, 29, 29)
                .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel47)
                    .addComponent(jComboBox15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(41, 41, 41)
                .addComponent(jLabelBotaoRegistrarNotas)
                .addGap(45, 45, 45)
                .addGroup(jPanelRegistrarNotasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel44)
                    .addComponent(jLabel43, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(88, Short.MAX_VALUE))
        );

        jPanelRegistrarNotas.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelRegistrarNotas, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "Matrícula", "Nome", "Nota 1", "Nota 2", "Nota 3", "Status"
            }
        ));
        jTable3.setEnabled(false);
        jScrollPane3.setViewportView(jTable3);

        jLabel38.setText("Relatório:");

        jButtonSalvarRelatorioTxt.setText("Salvar");
        jButtonSalvarRelatorioTxt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSalvarRelatorioTxtActionPerformed(evt);
            }
        });

        jButtonImprimirRelatorioNotas.setText("Salvar e Imprimir");
        jButtonImprimirRelatorioNotas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonImprimirRelatorioNotasActionPerformed(evt);
            }
        });

        jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        AtualizaSemestre.setText("Atualizar");
        AtualizaSemestre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AtualizaSemestreActionPerformed(evt);
            }
        });

        jComboBox16.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel1.setText("/");

        javax.swing.GroupLayout jPanelAlunosDeUmaDisciplinaLayout = new javax.swing.GroupLayout(jPanelAlunosDeUmaDisciplina);
        jPanelAlunosDeUmaDisciplina.setLayout(jPanelAlunosDeUmaDisciplinaLayout);
        jPanelAlunosDeUmaDisciplinaLayout.setHorizontalGroup(
            jPanelAlunosDeUmaDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createSequentialGroup()
                .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel52, javax.swing.GroupLayout.PREFERRED_SIZE, 482, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel38)
                        .addGap(35, 35, 35)
                        .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButtonSalvarRelatorioTxt)
                            .addComponent(jButtonImprimirRelatorioNotas)))
                    .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 654, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(jComboBox7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel1)
                        .addGap(9, 9, 9)
                        .addComponent(jComboBox16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(AtualizaSemestre)))
                .addContainerGap(326, Short.MAX_VALUE))
        );

        jPanelAlunosDeUmaDisciplinaLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonImprimirRelatorioNotas, jButtonSalvarRelatorioTxt});

        jPanelAlunosDeUmaDisciplinaLayout.setVerticalGroup(
            jPanelAlunosDeUmaDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1)
                    .addComponent(jComboBox16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(AtualizaSemestre))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel52, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(46, 46, 46)
                .addGroup(jPanelAlunosDeUmaDisciplinaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel38)
                    .addComponent(jButtonSalvarRelatorioTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addComponent(jButtonImprimirRelatorioNotas)
                .addContainerGap(50, Short.MAX_VALUE))
        );

        jPanelAlunosDeUmaDisciplina.setBounds(0, -10, 990, 450);
        jLayeredPane3.add(jPanelAlunosDeUmaDisciplina, javax.swing.JLayeredPane.DRAG_LAYER);

        topo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/back.png"))); // NOI18N

        jLabelRegistrarNota.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/addNotasMenor.png"))); // NOI18N
        jLabelRegistrarNota.setToolTipText("Registrar Notas");
        jLabelRegistrarNota.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelRegistrarNotaMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelRegistrarNotaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelRegistrarNotaMouseExited(evt);
            }
        });

        jLabelMatricular.setText("matricular");
        jLabelMatricular.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelMatricularMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelMatricularMouseEntered(evt);
            }
        });

        jLabelCadastrarDisciplina.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/images/cadastrarmenor.png"))); // NOI18N
        jLabelCadastrarDisciplina.setToolTipText("Cadastrar Disciplina");
        jLabelCadastrarDisciplina.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelCadastrarDisciplinaMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabelCadastrarDisciplinaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabelCadastrarDisciplinaMouseExited(evt);
            }
        });

        jLabel2.setText("Semestre:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelCadastrarAluno, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelInfoAluno, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabelCadastrarDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelListar, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabelExcluir, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabelMatricular)
                .addGap(26, 26, 26)
                .addComponent(jLabelRegistrarNota, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelEstatisticas, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelInfoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLayeredPane3))
                .addComponent(topo, javax.swing.GroupLayout.Alignment.LEADING))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 550, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(476, 476, 476)
                    .addComponent(jLabel2)
                    .addContainerGap(477, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(topo, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabelInfoSistema, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelEstatisticas, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelRegistrarNota, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelExcluir, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelListar, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelCadastrarDisciplina, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelInfoAluno, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelCadastrarAluno, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelMatricular))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(61, 61, 61)
                .addComponent(jLayeredPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(314, 314, 314)
                    .addComponent(jLabel2)
                    .addContainerGap(315, Short.MAX_VALUE)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    //classe interna-> CellRenderer

    private class MyCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer {

        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            if (value.toString().equals("EM CURSO")) {
                setBackground(Color.CYAN);
            }
            if (value.toString().equals("")) {
                setBackground(Color.white);
            }
            if (value.toString().equals("APROVADO")) {
                setBackground(Color.green);
            }
            if (value.toString().equals("REPROVADO")) {
                setBackground(Color.red);
            }
            if (column == 0) {
                setToolTipText(value.toString());
            }


            return this;
        }
    }
    private void jLabelCadastrarDisciplinaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelCadastrarDisciplinaMouseClicked
        // TODO add your handling code here:


        jPanelCadastrarDisciplina.setVisible(true);
        jPanelCadastrarAluno.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelInicio.setVisible(false);
        jPanelTodosAlunos.setVisible(false);
        jPanelListar.setVisible(false);
        jPanelInfoAluno.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jPanelExcluir.setVisible(false);
        jPanelEstatisticas.setVisible(false);
        jPanelRegistrarNotas.setVisible(false);
        jPanelVerAluno.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelInfoSistema.setVisible(false);
        jLayeredPane3.moveToFront(jPanelCadastrarDisciplina);
        jTextField2.setText("");
        jTextField1.setText("");

    }//GEN-LAST:event_jLabelCadastrarDisciplinaMouseClicked

    /**
     * Acoes realizadas ao clicar no jLabelListar
     * @param evt
     */
    private void jLabelListarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelListarMouseClicked
        
        
        // seta a visualizacao dos subpanels para false
        jPanelCadastrarDisciplina.setVisible(false);
        jPanelRegistrarNotas.setVisible(false);
        jPanelTodosAlunos.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelInicio.setVisible(false);
        jPanelCadastrarAluno.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jPanelInfoAluno.setVisible(false);
        jPanelExcluir.setVisible(false);
        jPanelEstatisticas.setVisible(false);
        jPanelVerAluno.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelInfoSistema.setVisible(false);

        // seta a visualizacao do jPanelListar para true
        jPanelListar.setVisible(true);
        
        // limpa e monta a lista de disciplinas
        DisciplinaDAO disciplinaDAO = DisciplinaDAO.getInstance();
        jComboBox3.removeAllItems();
        jComboBox3.setBackground(Color.white);
        montaComboBoxDisciplina(disciplinaDAO.getListaDeDisciplinas(), jComboBox3);

        jLayeredPane3.moveToFront(jPanelListar);
    }//GEN-LAST:event_jLabelListarMouseClicked

    /**
     * Adiciona na JComboBox passada por parametro dois campos, referentes
     * aos semestres letivos do ano corrente. E usado no metodo
     * jLabelRegistrarNotasMouseClicked.
     * @param comboBox
     */
    private void montarComboBoxPeriodosLetivos(JComboBox comboBox){
        Calendar c   = Calendar.getInstance();
        int      ano = c.get(c.YEAR);
        comboBox.addItem(ano+".1");
        comboBox.addItem(ano+".2");
    }
    private void jLabelEstatisticasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEstatisticasMouseClicked
        // TODO add your handling code here:

        jPanelCadastrarDisciplina.setVisible(false);
        jPanelCadastrarAluno.setVisible(false);
        jPanelListar.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelInfoAluno.setVisible(false);
        jPanelExcluir.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jPanelInicio.setVisible(false);
        jPanelRegistrarNotas.setVisible(false);
        jPanelEstatisticas.setVisible(true);
        jPanelTodosAlunos.setVisible(false);
        jPanelVerAluno.setVisible(true);
        jPanelInfoSistema.setVisible(false);
        jLayeredPane3.moveToFront(jPanelEstatisticas);

    }//GEN-LAST:event_jLabelEstatisticasMouseClicked

    /**
     * Acoes realizadas ao clicar-se no jLabelExcluir
     * @param evt
     */
    private void jLabelExcluirMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelExcluirMouseClicked

        // seta a visualizacao dos demais subpanels pra false
        jRadioButton1.setSelected(true);
        jComboBox2.removeAllItems();
        jComboBox1.removeAllItems();
        jComboBox4.removeAllItems();
        jComboBox6.removeAllItems();
        jComboBox1.setBackground(Color.white);
        jComboBox4.setBackground(Color.white);
        jComboBox6.setBackground(Color.white);
        jComboBox2.setBackground(Color.white);
        jPanelCadastrarDisciplina.setVisible(false);
        jPanelCadastrarAluno.setVisible(false);
        jPanelTodosAlunos.setVisible(false);
        jPanelListar.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelRegistrarNotas.setVisible(false);
        jPanelInfoAluno.setVisible(false);
        jPanelInicio.setVisible(false);
        jPanelEstatisticas.setVisible(false);
        jPanelVerAluno.setVisible(false);
        jPanelInfoSistema.setVisible(false);

        // seta a visualizacao do jPanelExcluir para true
        jPanelExcluir.setVisible(true);


        // monta JComboBox com Alunos e Disciplinas utilizadas na exclusao
        DisciplinaDAO disciplinaDAO = DisciplinaDAO.getInstance();
        AlunoDAO      alunoDAO      = AlunoDAO.getInstance();
        montaComboBoxDisciplina(disciplinaDAO.getListaDeDisciplinas(), jComboBox2);
        montaComboBoxAluno(alunoDAO.getListaDeAlunos(), jComboBox4);
        montaComboBoxAluno(alunoDAO.getListaDeAlunos(), jComboBox6);

        // monta a lista de disciplinas na qual o aluno selecionado esta matriculado
        if (jComboBox6.getItemCount() != 0) {
            String matriculaAluno = jComboBox6.getSelectedItem().toString().substring(0, jComboBox6.getSelectedItem().toString().indexOf(" "));
            NotasDAO notasDAO = NotasDAO.getInstance();
            montarComboBoxDisciplinaAluno(notasDAO.ArrayListDisciplinaAluno(matriculaAluno), jComboBox1);
        }
        jLayeredPane3.moveToFront(jPanelExcluir);
    }//GEN-LAST:event_jLabelExcluirMouseClicked

    private void jLabelCadastrarAlunoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelCadastrarAlunoMouseClicked

        // seta a visualizacao dos subpanels para false
        jPanelCadastrarDisciplina.setVisible(false);
        jPanelInicio.setVisible(false);
        jPanelListar.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jPanelTodosAlunos.setVisible(false);
        jPanelExcluir.setVisible(false);
        jPanelRegistrarNotas.setVisible(false);
        jPanelInfoAluno.setVisible(false);
        jPanelEstatisticas.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelVerAluno.setVisible(false);
        jPanelInfoSistema.setVisible(false);
        
        // seta a visualizacao do panel cadastrar aluno para true
        jPanelCadastrarAluno.setVisible(true);
        jTextField5.setText("");
        jTextField6.setText("");
        jLayeredPane3.moveToFront(jPanelCadastrarAluno);


    }//GEN-LAST:event_jLabelCadastrarAlunoMouseClicked

    /**
     * Acoes que sao realizadas ao clicar-se no jLabel Ver Aluno.
     * @param evt
     */
    private void jLabelInfoAlunoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInfoAlunoMouseClicked
        
        // seta a visualizacao dos demais subpanels para false
        jPanelCadastrarDisciplina.setVisible(false);
        jPanelTodosAlunos.setVisible(false);
        jPanelCadastrarAluno.setVisible(false);
        jPanelListar.setVisible(false);
        jPanelExcluir.setVisible(false);
        jPanelInfoAluno.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jPanelEstatisticas.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelRegistrarNotas.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelInfoSistema.setVisible(false);
        jPanelInicio.setVisible(false);

        // limpa a jComboBox5, que contera os alunos cadastrados no sistema
        jComboBox5.removeAllItems();
        jComboBox5.setBackground(Color.white);

        // preenche jComboBox5
        AlunoDAO alunoDAO = AlunoDAO.getInstance();
        montaComboBoxAluno(alunoDAO.getListaDeAlunos(), jComboBox5);
        
        // seta a visualizacao do jPanelVerAluno para true
        jPanelVerAluno.setVisible(true);
        jLayeredPane3.moveToFront(jPanelVerAluno);
    }//GEN-LAST:event_jLabelInfoAlunoMouseClicked

    private void jLabelInfoSistemaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInfoSistemaMouseClicked
        // TODO add your handling code here:

        jPanelCadastrarDisciplina.setVisible(false);
        jPanelCadastrarAluno.setVisible(false);
        jPanelListar.setVisible(false);
        jPanelTodosAlunos.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelRegistrarNotas.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelInfoAluno.setVisible(false);
        jPanelExcluir.setVisible(false);
        jPanelInicio.setVisible(false);
        jPanelEstatisticas.setVisible(false);
        jPanelVerAluno.setVisible(false);
        jPanelInfoSistema.setVisible(true);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jLayeredPane3.moveToFront(jPanelInfoSistema);

    }//GEN-LAST:event_jLabelInfoSistemaMouseClicked

    private void jLabelCadastrarDisciplinaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelCadastrarDisciplinaMouseEntered
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\cadastrar.png");
        jLabelCadastrarDisciplina.setIcon(icone);
    }//GEN-LAST:event_jLabelCadastrarDisciplinaMouseEntered

    private void jLabelListarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelListarMouseEntered
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\listar.png");
        jLabelListar.setIcon(icone);
    }//GEN-LAST:event_jLabelListarMouseEntered

    private void jLabelEstatisticasMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEstatisticasMouseEntered
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\estatistica.png");
        jLabelEstatisticas.setIcon(icone);
    }//GEN-LAST:event_jLabelEstatisticasMouseEntered

    private void jLabelExcluirMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelExcluirMouseEntered
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\excluir.png");
        jLabelExcluir.setIcon(icone);
    }//GEN-LAST:event_jLabelExcluirMouseEntered

    private void jLabelCadastrarAlunoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelCadastrarAlunoMouseEntered
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\add_aluno.png");
        jLabelCadastrarAluno.setIcon(icone);
    }//GEN-LAST:event_jLabelCadastrarAlunoMouseEntered

    private void jLabelInfoAlunoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInfoAlunoMouseEntered
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\aluno.png");
        jLabelInfoAluno.setIcon(icone);
    }//GEN-LAST:event_jLabelInfoAlunoMouseEntered

    private void jLabelInfoSistemaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInfoSistemaMouseEntered
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\info.png");
        jLabelInfoSistema.setIcon(icone);
    }//GEN-LAST:event_jLabelInfoSistemaMouseEntered

    private void jLabelCadastrarDisciplinaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelCadastrarDisciplinaMouseExited
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\cadastrarmenor.png");
        jLabelCadastrarDisciplina.setIcon(icone);
    }//GEN-LAST:event_jLabelCadastrarDisciplinaMouseExited

    private void jLabelListarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelListarMouseExited
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\listarmenor.png");
        jLabelListar.setIcon(icone);
    }//GEN-LAST:event_jLabelListarMouseExited

    private void jLabelEstatisticasMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelEstatisticasMouseExited
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\estatisticamenor.png");
        jLabelEstatisticas.setIcon(icone);
    }//GEN-LAST:event_jLabelEstatisticasMouseExited

    private void jLabelExcluirMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelExcluirMouseExited
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\excluirmenor.png");
        jLabelExcluir.setIcon(icone);
    }//GEN-LAST:event_jLabelExcluirMouseExited

    private void jLabelCadastrarAlunoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelCadastrarAlunoMouseExited
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\addmenor.png");
        jLabelCadastrarAluno.setIcon(icone);
    }//GEN-LAST:event_jLabelCadastrarAlunoMouseExited

    private void jLabelInfoAlunoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInfoAlunoMouseExited
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\alunomenor.png");
        jLabelInfoAluno.setIcon(icone);
    }//GEN-LAST:event_jLabelInfoAlunoMouseExited

    private void jLabelInfoSistemaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelInfoSistemaMouseExited
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\infomenor.png");
        jLabelInfoSistema.setIcon(icone);
    }//GEN-LAST:event_jLabelInfoSistemaMouseExited

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBox1ActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jRadioButton2ActionPerformed

    private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBox2ActionPerformed

    private void jRadioButton1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButton1ItemStateChanged
        // TODO add your handling code here:
        if (evt.getStateChange() == ItemEvent.SELECTED) {
            jComboBox4.setEnabled(true);
            jComboBox6.setEnabled(false);
            jComboBox1.setEnabled(false);
            jComboBox2.setEnabled(false);
        }
    }//GEN-LAST:event_jRadioButton1ItemStateChanged

    private void jRadioButton2ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButton2ItemStateChanged
        // TODO add your handling code here:
        if (evt.getStateChange() == ItemEvent.SELECTED) {
            jComboBox4.setEnabled(false);
            jComboBox6.setEnabled(true);
            jComboBox1.setEnabled(true);
            jComboBox2.setEnabled(false);
        }
    }//GEN-LAST:event_jRadioButton2ItemStateChanged

    private void jRadioButton3ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButton3ItemStateChanged
        // TODO add your handling code here:
        if (evt.getStateChange() == ItemEvent.SELECTED) {

            jComboBox6.setEnabled(false);
            jComboBox1.setEnabled(false);
            jComboBox2.setEnabled(true);
        }
    }//GEN-LAST:event_jRadioButton3ItemStateChanged

    private void jRadioButton4ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButton4ItemStateChanged
        // TODO add your handling code here:
        if (evt.getStateChange() == ItemEvent.SELECTED) {
            jComboBox3.setEnabled(false);
        }
    }//GEN-LAST:event_jRadioButton4ItemStateChanged

    private void jRadioButton5ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jRadioButton5ItemStateChanged
        // TODO add your handling code here:
        if (evt.getStateChange() == ItemEvent.SELECTED) {
            jComboBox3.setEnabled(true);
        }
    }//GEN-LAST:event_jRadioButton5ItemStateChanged

    /**
     * Acoes que sao realizadas ao clicar-se no jLabel de Registrar Notas
     * @param evt
     */
    private void jLabelRegistrarNotaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelRegistrarNotaMouseClicked

        // seta os demais subpanels para false
        jPanelCadastrarDisciplina.setVisible(false);
        jPanelCadastrarAluno.setVisible(false);
        jPanelListar.setVisible(false);
        jPanelTodosAlunos.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jPanelExcluir.setVisible(false);
        jPanelInicio.setVisible(false);
        jPanelEstatisticas.setVisible(false);
        jPanelVerAluno.setVisible(false);
        jPanelInfoSistema.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);

        // seta o panel de registrar notas para true
        jPanelRegistrarNotas.setVisible(true);
        jLayeredPane3.moveToFront(jPanelRegistrarNotas);
        teste = false;

        // limpa a jComboBox com a lista de Alunos
        jComboBox8.removeAllItems();
        // limpa a jComboBox com a lista de Disciplinas
        jComboBox9.removeAllItems();
        // limpa a jComboBox com os tipos de notas
        jComboBox12.removeAllItems();
        // limpa a jComboBox com os valores das notas
        jComboBox13.removeAllItems();
        // limpa a jComboBox com os valores dos semestres
        jComboBox15.removeAllItems();
        // seta a background color das jComboBox
        jComboBox15.setBackground(Color.white);
        jComboBox8.setBackground(Color.white);
        jComboBox9.setBackground(Color.white);
        jComboBox12.setBackground(Color.white);
        jComboBox13.setBackground(Color.white);

        // preenche a jComboBox8 com a lista de Alunos cadastrados no sistema
        AlunoDAO alunoDAO = AlunoDAO.getInstance();
        montaComboBoxAluno(alunoDAO.getListaDeAlunos(), jComboBox8);  

        // preenche a jComboBox12 com os tipos de Notas
        jComboBox12.addItem("NOTA_1");
        jComboBox12.addItem("NOTA_2");
        jComboBox12.addItem("NOTA_3");
        jComboBox12.addItem("NOTA_FINAL");

        // preenche a jComboBox13 com os valores possiveis para as notas
        for (int i = 0; i < 101; i++) {
            jComboBox13.addItem((double) i / 10);               
        }

        // monta em jComboBox15 uma lista de semestres letivos do ano corrente
        montarComboBoxPeriodosLetivos(jComboBox15);

        // preenche a jComboBox9 com as Disciplinas que o aluno selecionado em jComboBox8 esta matriculadp
        NotasDAO notasDAO = NotasDAO.getInstance();
        montarComboBoxDisciplinaAluno(notasDAO.ArrayListDisciplinaAluno(jComboBox8.getSelectedItem().toString().substring(0, jComboBox8.getSelectedItem().toString().indexOf(" "))), jComboBox9);

        teste = true;
    }//GEN-LAST:event_jLabelRegistrarNotaMouseClicked

    private void jLabelRegistrarNotaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelRegistrarNotaMouseEntered
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\addNotas.png");
        jLabelRegistrarNota.setIcon(icone);
    }//GEN-LAST:event_jLabelRegistrarNotaMouseEntered

    private void jLabelRegistrarNotaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelRegistrarNotaMouseExited
        // TODO add your handling code here:
        ImageIcon icone = new ImageIcon(".\\src\\resources\\images\\addNotasMenor.png");
        jLabelRegistrarNota.setIcon(icone);
    }//GEN-LAST:event_jLabelRegistrarNotaMouseExited

    private void jRadioButton4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jRadioButton4MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jRadioButton4MouseClicked

    private void jComboBox4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBox4ActionPerformed

    private void jComboBox5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox5ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBox5ActionPerformed

    /**
     * Acoes que sao realizadas ao clicar-se no jLabelMatricular,
     * ativando a visualizacao do JPanel matricular
     * @param evt
     */
    private void jLabelMatricularMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelMatricularMouseClicked
        
        // limpa as JComboBox contendo Alunos, Disciplinas e Semestres
        jComboBox10.removeAllItems();
        jComboBox11.removeAllItems();
        jComboBox14.removeAllItems();
        jComboBox11.setBackground(Color.white);
        jComboBox10.setBackground(Color.white);
        jComboBox14.setBackground(Color.white);

        //seta a visualizacao dos demais subpanels para false
        jPanelCadastrarDisciplina.setVisible(false);
        jPanelCadastrarAluno.setVisible(false);
        jPanelListar.setVisible(false);
        jPanelTodosAlunos.setVisible(false);
        jPanelMatricularAluno.setVisible(false);
        jPanelAlunosDeUmaDisciplina.setVisible(false);
        jPanelExcluir.setVisible(false);
        jPanelInicio.setVisible(false);
        jPanelEstatisticas.setVisible(false);
        jPanelVerAluno.setVisible(false);
        jPanelInfoAluno.setVisible(false);
        jPanelInfoSistema.setVisible(false);
        jPanelRegistrarNotas.setVisible(false);

        // seta a visualizacao do jPanelMatricularAluno para true
        jPanelMatricularAluno.setVisible(true);

        // preenche jComboBox10 com os alunos cadastrados no sistema
        AlunoDAO alunoDAO = AlunoDAO.getInstance();
        montaComboBoxAluno(alunoDAO.getListaDeAlunos(), jComboBox10);
        // preenche jComboBox11 com as disciplinas cadastradas no sistema
        DisciplinaDAO disciplinaDAO = DisciplinaDAO.getInstance();
        montaComboBoxDisciplina(disciplinaDAO.getListaDeDisciplinas(), jComboBox11);
        // preenche jComboBox14 com os semestres letivos do ano corrente
        montarComboBoxPeriodosLetivos(jComboBox14);
        jLayeredPane3.moveToFront(jPanelMatricularAluno);
    }//GEN-LAST:event_jLabelMatricularMouseClicked

    private void jComboBox9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox9ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBox9ActionPerformed

    private void jComboBox6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox6ActionPerformed
        // TODO add your handling code here:
        if (jRadioButton2.isSelected()) {
            NotasDAO notasDAO = NotasDAO.getInstance();
            jComboBox1.removeAllItems();
            montarComboBoxDisciplinaAluno(notasDAO.ArrayListDisciplinaAluno(jComboBox6.getSelectedItem().toString().substring(0, jComboBox6.getSelectedItem().toString().indexOf(" "))), jComboBox1);
        }
    }//GEN-LAST:event_jComboBox6ActionPerformed

    private void jComboBox8ActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        if (teste) {
            NotasDAO notasDAO = NotasDAO.getInstance();
            jComboBox9.removeAllItems();
            montarComboBoxDisciplinaAluno(notasDAO.ArrayListDisciplinaAluno(jComboBox8.getSelectedItem().toString().substring(0, jComboBox8.getSelectedItem().toString().indexOf(" "))), jComboBox9);
        }
    }
        private void jLabelBotaoExcluirMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoExcluirMouseExited
            // TODO add your handling code here:
            jLabelBotaoExcluir.setIcon(new ImageIcon(".\\src\\resources\\images\\bExcluir.png"));
        }//GEN-LAST:event_jLabelBotaoExcluirMouseExited

        private void jLabelBotaoExcluirMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoExcluirMouseEntered
            // TODO add your handling code here:
            jLabelBotaoExcluir.setIcon(new ImageIcon(".\\src\\resources\\images\\bExcluirRollover.png"));
        }//GEN-LAST:event_jLabelBotaoExcluirMouseEntered

        /**
         * Acoes realizadas ao clicar no jLabelBotaoExcluir
         * @param evt
         */
        private void jLabelBotaoExcluirMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoExcluirMouseClicked

            // excluir aluno do sistema
            if (jRadioButton1.isSelected()) {
                if (jComboBox4.getItemCount() != 0) {
                    String matriculaAluno = jComboBox4.getSelectedItem().toString();
                    jComboBox6.removeItemAt(jComboBox4.getSelectedIndex());
                    jComboBox4.removeItemAt(jComboBox4.getSelectedIndex());

                    int i = matriculaAluno.indexOf(' ');
                    matriculaAluno = matriculaAluno.substring(0, i);

                    AlunoDAO alunoDAO = AlunoDAO.getInstance();
                    Aluno aluno = alunoDAO.ProcurarAluno(matriculaAluno);
                    alunoDAO.excluir(aluno);
                    NotasDAO notasDAO = NotasDAO.getInstance();
                    notasDAO.excluirAlunoDaTabelaDeNotas(aluno);
                } else {
                    JOptionPane.showMessageDialog(null, "Nenhum aluno matriculado! Exclusão impossível.", "", JOptionPane.ERROR_MESSAGE);
                }
            }

            // excluir aluno de disciplina
            if (jRadioButton2.isSelected()) {
                if ((jComboBox6.getItemCount() != 0) && (jComboBox1.getItemCount() != 0)) {
                    String matriculaAluno = jComboBox6.getSelectedItem().toString();
                    int i = matriculaAluno.indexOf(' ');
                    matriculaAluno = matriculaAluno.substring(0, i);
                    Aluno aluno = new Aluno("", matriculaAluno);

                    String codigoDisciplina = jComboBox1.getSelectedItem().toString();
                    i = codigoDisciplina.indexOf(' ');
                    codigoDisciplina = codigoDisciplina.substring(0, i);
                    Disciplina disciplina = new Disciplina(codigoDisciplina, "");

                    NotasDAO notasDAO = NotasDAO.getInstance();
                    notasDAO.excluirAlunoDeDisciplina(aluno, disciplina);
                    jComboBox1.removeItemAt(jComboBox1.getSelectedIndex());
                }
                if (jComboBox6.getItemCount() == 0) {
                    JOptionPane.showMessageDialog(null, "Nenhum aluno matriculado! Exclusão impossível.", "", JOptionPane.ERROR_MESSAGE);
                }
                if ((jComboBox6.getItemCount() != 0) && (jComboBox1.getItemCount() == 0)) {
                    JOptionPane.showMessageDialog(null, "O Aluno não está matriculado em nenhuma disciplina! Exclusão impossível.", "", JOptionPane.ERROR_MESSAGE);
                }
            }

            // excluir disciplina do sistema
            if (jRadioButton3.isSelected()) {
                if (jComboBox2.getItemCount() != 0) {
                    String codigoDisciplina = jComboBox2.getSelectedItem().toString();

                    for (int i = 0; i < jComboBox1.getItemCount(); i++) {
                        if (jComboBox1.getItemAt(i).toString().equals(codigoDisciplina)) {
                            jComboBox1.removeItemAt(i);
                            break;
                        }
                    }
                    jComboBox2.removeItemAt(jComboBox2.getSelectedIndex());

                    int i = codigoDisciplina.indexOf(' ');
                    codigoDisciplina = codigoDisciplina.substring(0, i);

                    //exclui a disciplina da tabela DISCIPLINA
                    DisciplinaDAO disciplinaDAO = DisciplinaDAO.getInstance();
                    Disciplina disciplina = disciplinaDAO.ProcuraDisciplina(codigoDisciplina);
                    disciplinaDAO.excluir(disciplina);

                    //exclui a disciplina da tabela NOTAS
                    NotasDAO notasDAO = NotasDAO.getInstance();
                    notasDAO.excluirDisciplinaDaTabelaDeNotas(disciplina);
                } else {
                    JOptionPane.showMessageDialog(null, "Nenhuma disciplina cadastrada! Exclusão impossível.", "", JOptionPane.ERROR_MESSAGE);
                }
            }
        }//GEN-LAST:event_jLabelBotaoExcluirMouseClicked

        private void jLabel46MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel46MouseClicked
            // TODO add your handling code here:
            String nome = jTextField1.getText();
            String codigo = jTextField2.getText();
            String msg = "";
            boolean code = true;
            boolean name = true;
            int i;

            if (nome.equals("")) {
                name = false;
                msg += "O Nome do aluno deve ser informado.\n";
            }
            if (codigo.equals("")) {
                code = false;
                msg += "O CÃ³digo da disciplina deve ser informado!\n";
            }
            for (i = 0; i < codigo.length(); i++) {
                if (!Character.isDigit(codigo.charAt(i))) {
                    msg += "O cÃ³digo sÃ³ deve conter nÃºmeros. NÃ£o Ã© permitido espaÃ§o em branco.";
                    code = false;
                    break;
                }
            }

            if (code && name) {
                Disciplina disciplina = new Disciplina(codigo, nome);
                DisciplinaDAO disciplinaDAO = DisciplinaDAO.getInstance();
                disciplinaDAO.cadastrar(disciplina);
                jTextField2.setText("");
                jTextField1.setText("");
            } else {
                JOptionPane.showMessageDialog(null, msg, "Erro", JOptionPane.ERROR_MESSAGE);
            }

            if (!code) {
                jTextField2.setText("");
            }
            if (!name) {
                jTextField1.setText("");
            }
        }//GEN-LAST:event_jLabel46MouseClicked

        private void jLabel46MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel46MouseEntered
            // TODO add your handling code here:
            jLabel46.setIcon(new ImageIcon(".\\src\\resources\\images\\bCadastrarRollover.png"));
        }//GEN-LAST:event_jLabel46MouseEntered

        private void jLabel46MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel46MouseExited
            // TODO add your handling code here:
            jLabel46.setIcon(new ImageIcon(".\\src\\resources\\images\\bCadastrar.png"));
        }//GEN-LAST:event_jLabel46MouseExited

    /**
     * Executado quando clicamos no botão Listar do painel "Listar Alunos"
     * @param evt
     */
        private void jLabelBotaoListarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoListarMouseClicked
            Calendar c   = Calendar.getInstance();
            int      mes = c.get(c.MONTH);
            int      ano= c.get(c.YEAR);
            String semestreAtual;

            if(mes >7) semestreAtual = ano+".2";
            else       semestreAtual = ano+".1";

            jComboBox7.removeAllItems();
            jComboBox16.removeAllItems();
            jComboBox7.addItem("1");jComboBox7.addItem("2");
            for(int i=2011;i<=ano;i++)jComboBox16.addItem(i);
            // Listar todos os alunos
            if (jRadioButton4.isSelected()) {

                // seta a visualizacao dos demais subpanels para false
                jPanelCadastrarDisciplina.setVisible(false);
                jPanelCadastrarAluno.setVisible(false);
                jPanelListar.setVisible(false);
                jPanelExcluir.setVisible(false);
                jPanelEstatisticas.setVisible(false);
                jPanelVerAluno.setVisible(false);
                jPanelInfoSistema.setVisible(false);
                jPanelInfoAluno.setVisible(false);
                jPanelMatricularAluno.setVisible(false);
                jPanelRegistrarNotas.setVisible(false);
                jPanelInicio.setVisible(false);
                jPanelMatricularAluno.setVisible(false);
                jPanelAlunosDeUmaDisciplina.setVisible(false);

                /**
                 * Limpa a tabela de listagem dos alunos.
                 * Necessário caso ocorra alguma alteração na listaDeAlunos do
                 * alunoDAO
                 */
                for (int i = 0; i < jTable1.getRowCount(); i++) {
                    jTable1.setValueAt("", i, 0);
                    jTable1.setValueAt("", i, 1);
                }

                AlunoDAO alunoDAO = AlunoDAO.getInstance();
                montarTabelaDeAlunos(alunoDAO.getListaDeAlunos(), jTable1);

                // seta a visualizacao do painel jPanelTodosAlunos para true
                jPanelTodosAlunos.setVisible(true);
                jLayeredPane3.moveToFront(jPanelTodosAlunos);
            }

            // Listar Alunos de Uma Disciplina
            if (jRadioButton5.isSelected()) {
                if (jComboBox3.getItemCount() != 0) {

                    // seta a visualizacao dos demais subpanels para false
                    jPanelCadastrarDisciplina.setVisible(false);
                    jPanelCadastrarAluno.setVisible(false);
                    jPanelListar.setVisible(false);
                    jPanelExcluir.setVisible(false);
                    jPanelEstatisticas.setVisible(false);
                    jPanelVerAluno.setVisible(false);
                    jPanelInfoSistema.setVisible(false);
                    jPanelInfoAluno.setVisible(false);
                    jPanelMatricularAluno.setVisible(false);
                    jPanelRegistrarNotas.setVisible(false);
                    jPanelInicio.setVisible(false);
                    jPanelMatricularAluno.setVisible(false);

                    /**
                     * Limpa a tabela de listagem dos alunos.
                     * Necessário caso ocorra alguma alteração na listaDeAlunos do
                     * alunoDAO
                     */
                    for (int i = 0; i < jTable3.getRowCount(); i++) {
                        jTable3.setValueAt("", i, 0);
                        jTable3.setValueAt("", i, 1);
                        jTable3.setValueAt("", i ,2);
                        jTable3.setValueAt("", i ,3);
                        jTable3.setValueAt("", i ,4);
                        jTable3.setValueAt("", i ,5);

                    }
                    // seta a visualizacao do jPanelAlunosDeUmaDisciplina para true
                    jPanelAlunosDeUmaDisciplina.setVisible(true);
                    jPanelTodosAlunos.setVisible(false);
                    jLayeredPane3.moveToFront(jPanelAlunosDeUmaDisciplina);

                    codigoDisciplina = jComboBox3.getSelectedItem().toString().substring(0, jComboBox3.getSelectedItem().toString().indexOf(' '));
                    DisciplinaDAO disciplinaDAO = DisciplinaDAO.getInstance();
                    Disciplina disciplina = disciplinaDAO.ProcuraDisciplina(codigoDisciplina);
                    disciplinaImpressao = disciplina;      //VARIAVEL PARA TABELA DE IMPRESSÂO
                    NotasDAO notasDAO = NotasDAO.getInstance();
                    ArrayList<Aluno> arrayList = notasDAO.montaListAlunosDeDisciplina(disciplina);


                    montarTabelaDeNotasDisciplina(arrayList,disciplina, jTable3, semestreAtual); //lista Aluno do semestre Atual
                    jLabel52.setText("Alunos matriculados em " + disciplina.getNome()+" Semestre "+semestreAtual);

                    
                } else {
                    JOptionPane.showMessageDialog(null, "Nenhuma disciplina cadastrada! Listagem impossível.", "", JOptionPane.ERROR_MESSAGE);
                }
            }
        }//GEN-LAST:event_jLabelBotaoListarMouseClicked

        private void jLabelBotaoListarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoListarMouseEntered
            // TODO add your handling code here:
            jLabelBotaoListar.setIcon(new ImageIcon(".\\src\\resources\\images\\bListarRollover.png"));
        }//GEN-LAST:event_jLabelBotaoListarMouseEntered

        private void jLabelBotaoListarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoListarMouseExited
            // TODO add your handling code here:
            jLabelBotaoListar.setIcon(new ImageIcon(".\\src\\resources\\images\\bListar.png"));
        }//GEN-LAST:event_jLabelBotaoListarMouseExited

        /**
         * Acoes realizadas ao clicar-se no jLabelBotaoCadastrarAluno
         * @param evt
         */
        private void jLabelBotaoCadastrarAlunoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoCadastrarAlunoMouseClicked
            
            String  nome      = jTextField6.getText();
            String  matricula = jTextField5.getText();
            String  msg       = "";
            boolean mat      = true;
            boolean name     = true;
            int     i;

            if (nome.equals("")) {
                name = false;
                msg += "O Nome do aluno deve ser informado.\n";
            }
            if (matricula.equals("")) {
                mat = false;
                msg += "A matricula do aluno deve ser informada!\n";
            }
            for (i = 0; i < matricula.length(); i++) {
                if (!Character.isDigit(matricula.charAt(i))) {
                    msg += "A matricula deve conter apenas numeros. Nao e permitido espacoes em branco.";
                    mat = false;
                    break;
                }
            }

            if (mat && name) {
                Aluno    aluno    = new Aluno(jTextField6.getText(), jTextField5.getText());
                AlunoDAO alunoDAO = AlunoDAO.getInstance();
                alunoDAO.cadastrar(aluno);
                jTextField6.setText("");
                jTextField5.setText("");
            } else {
                JOptionPane.showMessageDialog(null, msg, "Erro", JOptionPane.ERROR_MESSAGE);
            }

            if (!mat) {
                jTextField5.setText("");
            }
            if (!name) {
                jTextField6.setText("");
            }
        }//GEN-LAST:event_jLabelBotaoCadastrarAlunoMouseClicked

        private void jLabelBotaoCadastrarAlunoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoCadastrarAlunoMouseEntered
            // TODO add your handling code here:
            jLabelBotaoCadastrarAluno.setIcon(new ImageIcon(".\\src\\resources\\images\\bAddRollover.png"));
        }//GEN-LAST:event_jLabelBotaoCadastrarAlunoMouseEntered

        private void jLabelBotaoCadastrarAlunoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoCadastrarAlunoMouseExited
            // TODO add your handling code here:
            jLabelBotaoCadastrarAluno.setIcon(new ImageIcon(".\\src\\resources\\images\\bAdd.png"));
        }//GEN-LAST:event_jLabelBotaoCadastrarAlunoMouseExited

        /**
         * Acoes que sao realizadas ao clicar-se no botao Visualizar do
         * jPanelVerAluno
         * @param evt
         */
        private void jLabelBotaoVisualizarAlunoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoVisualizarAlunoMouseClicked
            
            if (jComboBox5.getItemCount() != 0) {

                jPanelCadastrarDisciplina.setVisible(false);
                jPanelCadastrarAluno.setVisible(false);
                jPanelListar.setVisible(false);
                jPanelTodosAlunos.setVisible(false);
                jPanelMatricularAluno.setVisible(false);
                jPanelMatricularAluno.setVisible(false);
                jPanelExcluir.setVisible(false);
                jPanelInicio.setVisible(false);
                jPanelAlunosDeUmaDisciplina.setVisible(false);
                jPanelEstatisticas.setVisible(false);
                jPanelVerAluno.setVisible(false);
                jPanelInfoSistema.setVisible(false);
                jPanelRegistrarNotas.setVisible(false);

                // seta a visualizacao do jPanelInfoAluno para true
                jPanelInfoAluno.setVisible(true);
                jLayeredPane3.moveToFront(jPanelInfoAluno);

                // limpa a tabela
                int i;
                for (i = 0; i < jTable2.getRowCount(); i++) {
                    jTable2.setValueAt("", i, 0);
                    jTable2.setValueAt("", i, 1);
                    jTable2.setValueAt("", i, 2);
                    jTable2.setValueAt("", i, 3);
                    jTable2.setValueAt("", i, 4);
                    jTable2.setValueAt("", i, 5);
                    jTable2.setValueAt("", i, 6);
                }
                
                // captura a matricula e o nome do aluno no jComboBox5
                String matricula = jComboBox5.getSelectedItem().toString();
                i                = matricula.indexOf(' ');
                String nome      = matricula.substring(i + 5, matricula.length());
                matricula        = matricula.substring(0, i);
                jTextField3.setText(nome);
                jTextField4.setText(matricula);

                // encontra o aluno na lista de alunos
                AlunoDAO alunoDAO = AlunoDAO.getInstance();
                Aluno aluno       = alunoDAO.ProcurarAluno(matricula);

                // procura as notas do aluno e monta  a tabela de notas
                NotasDAO notasDAO = NotasDAO.getInstance();
                ArrayList<Notas> arrayList = notasDAO.montaListNotasDoAluno(aluno);

                montaTableNotasAluno(arrayList, jTable2);
                jTable2.getColumnModel().getColumn(6).setCellRenderer(new MyCellRenderer());
                jTable2.getColumnModel().getColumn(0).setCellRenderer(new MyCellRenderer());
            } else {
                JOptionPane.showMessageDialog(null, "Nenhum aluno matriculado.", "", JOptionPane.ERROR_MESSAGE);
            }
        }//GEN-LAST:event_jLabelBotaoVisualizarAlunoMouseClicked

        private void jLabelBotaoVisualizarAlunoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoVisualizarAlunoMouseEntered
            // TODO add your handling code here:
            jLabelBotaoVisualizarAluno.setIcon(new ImageIcon(".\\src\\resources\\images\\bVisualizarRollover.png"));
        }//GEN-LAST:event_jLabelBotaoVisualizarAlunoMouseEntered

        private void jLabelBotaoVisualizarAlunoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoVisualizarAlunoMouseExited
            // TODO add your handling code here:
            jLabelBotaoVisualizarAluno.setIcon(new ImageIcon(".\\src\\resources\\images\\bVisualizar.png"));
        }//GEN-LAST:event_jLabelBotaoVisualizarAlunoMouseExited

        private void jLabelBotaoMatricularMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoMatricularMouseClicked
            // TODO: Adicionar código / panel para capturar semestre
            if ((jComboBox10.getItemCount() != 0)&&(jComboBox11.getItemCount() != 0)) {
                NotasDAO notasDAO = NotasDAO.getInstance();
                String matricula = jComboBox10.getSelectedItem().toString();
                matricula = matricula.substring(0, matricula.indexOf(' '));
                Aluno aluno = AlunoDAO.getInstance().ProcurarAluno(matricula);
                String codigo = jComboBox11.getSelectedItem().toString();
                codigo = codigo.substring(0, codigo.indexOf(' '));
                Disciplina disciplina = DisciplinaDAO.getInstance().ProcuraDisciplina(codigo);

                Notas nota = new Notas(aluno, disciplina, new ArrayList<Double>(), -1.0, "EM CURSO",jComboBox14.getSelectedItem().toString());

                notasDAO.matricularAluno(nota);
            } else {
                JOptionPane.showMessageDialog(null, "Não é possível realizar a matrícula", "", JOptionPane.ERROR_MESSAGE);
            }
        }//GEN-LAST:event_jLabelBotaoMatricularMouseClicked

        private void jLabelBotaoMatricularMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoMatricularMouseEntered
            // TODO add your handling code here:
            jLabelBotaoMatricular.setIcon(new ImageIcon(".\\src\\resources\\images\\bMatricularRollover.png"));
        }//GEN-LAST:event_jLabelBotaoMatricularMouseEntered

        private void jLabelBotaoMatricularMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoMatricularMouseExited
            // TODO add your handling code here:
            jLabelBotaoMatricular.setIcon(new ImageIcon(".\\src\\resources\\images\\bMatricular.png"));
        }//GEN-LAST:event_jLabelBotaoMatricularMouseExited

    private void montaTableNotasAluno(ArrayList<Notas> notasDoAluno, JTable tabela) {
        int i = 0;
        int j = notasDoAluno.size();

        while (i < j) {


            if (i > tabela.getRowCount() - 1) {
                DefaultTableModel modelo = new DefaultTableModel();
                modelo = (DefaultTableModel) tabela.getModel();
                modelo.addRow(new String[]{"", ""});
                tabela.setModel(modelo);

            }
            tabela.setValueAt(notasDoAluno.get(i).getDisciplina().getNome(), i, 0);


            int size = notasDoAluno.get(i).getNotas().size();
            int k = 0;

            while (k < size) {
                tabela.setValueAt(notasDoAluno.get(i).getNotas().get(k), i, k + 1);
                k++;
            }

            while (k < 4) {
                tabela.setValueAt("NR", i, k + 1);
                k++;
            }

            if (notasDoAluno.get(i).getMedia() != -1.0) {
                tabela.setValueAt(notasDoAluno.get(i).getMedia(), i, 5);
            } else {
                tabela.setValueAt("NR", i, 5);
            }

            tabela.setValueAt(notasDoAluno.get(i).getStatus(), i, 6);



            i++;
        }
    }
        private void jLabelBotaoRegistrarNotasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoRegistrarNotasMouseClicked
            // TODO adicionar panel para capturar o semestre
            // TODO adicionar código para capturar o semestre
            String matricula = jComboBox8.getSelectedItem().toString().substring(0, jComboBox8.getSelectedItem().toString().indexOf(' '));
            String codigoDisciplina = jComboBox9.getSelectedItem().toString().substring(0, jComboBox9.getSelectedItem().toString().indexOf(' '));
            String nota = jComboBox12.getSelectedItem().toString();
            StringBuilder labelText = new StringBuilder();
            Double valor = Double.parseDouble(jComboBox13.getSelectedItem().toString());

            NotasDAO notasDAO = NotasDAO.getInstance();
            Notas notaList = notasDAO.ProcuraNota(matricula, codigoDisciplina,jComboBox15.getSelectedItem().toString());
            notasDAO.setNotas(nota, notaList, valor);

            notaList.calcularMedia();
            notaList.atualizaStatus();

            notasDAO.atualizaMedia(notaList);
            notasDAO.atualizaStatus(notaList);


            jLabel44.setText(labelText.toString());
        }//GEN-LAST:event_jLabelBotaoRegistrarNotasMouseClicked

        private void jLabelBotaoRegistrarNotasMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoRegistrarNotasMouseEntered
            // TODO add your handling code here:
            jLabelBotaoRegistrarNotas.setIcon(new ImageIcon(".\\src\\resources\\images\\bRegistrarRollover.png"));
        }//GEN-LAST:event_jLabelBotaoRegistrarNotasMouseEntered

        private void jLabelBotaoRegistrarNotasMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelBotaoRegistrarNotasMouseExited
            // TODO add your handling code here:
            jLabelBotaoRegistrarNotas.setIcon(new ImageIcon(".\\src\\resources\\images\\bRegistrar.png"));
        }//GEN-LAST:event_jLabelBotaoRegistrarNotasMouseExited

        private void jLabelMatricularMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelMatricularMouseEntered
            // TODO add your handling code here:
        }//GEN-LAST:event_jLabelMatricularMouseEntered

        private void jComboBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox3ActionPerformed
            // TODO add your handling code here:
        }//GEN-LAST:event_jComboBox3ActionPerformed

        /**
         * Salva o relatorio em arquivo .txt
         * @param evt
         */
        private void jButtonSalvarRelatorioTxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSalvarRelatorioTxtActionPerformed

            //função para pegar a data;
            Date d = new Date();
            StringBuilder data = new StringBuilder();
            SimpleDateFormat sdfData = new SimpleDateFormat("dd.MM.yyy");
            data.append(sdfData.format(d));
            SimpleDateFormat sdfHora = new SimpleDateFormat("HH:mm:ss");
            
            NotasDAO notasDao = NotasDAO.getInstance();
            ArrayList<Aluno> listaAluno = new ArrayList<Aluno>();
            listaAluno = notasDao.montaListAlunosDeDisciplina(disciplinaImpressao);
            NotasDAO notasDAO = NotasDAO.getInstance();

            String cabecalho = ("SADAF\r\n"
                    +"Relatorio de Notas da Disciplina : "+disciplinaImpressao.getNome()
                    +"\r\n Emitido em : "+data.toString()+" as "+sdfHora.format(d)
                    +"\r\n ALUNO    -   MATRICULA   -   NOTA1   -   NOTA2   -   NOTA3   -   STATUS \r\n\r\n");

            String concat = "";
            String concat2 = "";
            String texto = "";
            texto = cabecalho;

            for(int i = 0 ; i < listaAluno.size() ; i++){

                ArrayList<Notas> arrayNotasAluno = notasDAO.montaListNotasDoAluno(listaAluno.get(i));

                if(!arrayNotasAluno.isEmpty()){

                    for(int j = 0 ; j < arrayNotasAluno.size() ; j++){
                        ArrayList<Double> listaNotas = new ArrayList<Double>();
                        listaNotas = arrayNotasAluno.get(j).getNotas();

                        Notas notasJ = arrayNotasAluno.get(j);
                        concat = notasJ.getAluno().getNome()+"  -  "+notasJ.getAluno().getMatricula()+"  -  ";
                        if(listaNotas.isEmpty())
                            concat2= "-l - -1 - -1 - "+notasJ.getStatus()+"\r\n";
                        else if(listaNotas.size() == 1)
                            concat2 = listaNotas.get(0)+" - -1 - -1 - "+notasJ.getStatus()+"\r\n";
                        else if(listaNotas.size() == 2)
                            concat2 = listaNotas.get(0)+" - "+listaNotas.get(1)+" - -1 - "+notasJ.getStatus()+"\r\n";
                        else if(listaNotas.size() > 2)
                            concat2 = listaNotas.get(0)+" - "+listaNotas.get(1)+" - "+listaNotas.get(2)+" - "+notasJ.getStatus()+"\r\n";

                        texto+="  "+concat+concat2+"\r\n";
                    }}}
            Gravar grav = new Gravar();
            grav.criaTxt(disciplinaImpressao.getNome(),texto);
}//GEN-LAST:event_jButtonSalvarRelatorioTxtActionPerformed

        /**
         * Imprime o relatorio de notas.
         * @param evt
         */
        private void jButtonImprimirRelatorioNotasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonImprimirRelatorioNotasActionPerformed

            //função para pegar a data;
            Date d = new Date();
            StringBuilder data = new StringBuilder();
            SimpleDateFormat sdfData = new SimpleDateFormat("dd.MM.yyy");
            data.append(sdfData.format(d));
            SimpleDateFormat sdfHora = new SimpleDateFormat("HH:mm:ss");
            
            NotasDAO notasDao = NotasDAO.getInstance();
            ArrayList<Aluno> listaAluno = new ArrayList<Aluno>();
            listaAluno = notasDao.montaListAlunosDeDisciplina(disciplinaImpressao);
            
            String cabecalho = ("SADAF -- Notas da Disciplina : "+disciplinaImpressao.getNome());

            String concat = "";
            String concat2 = "";
            String texto = "";

            texto = cabecalho;

            for(int i = 0 ; i < listaAluno.size() ; i++){

                ArrayList<Notas> arrayNotasAluno = notasDao.montaListNotasDoAluno(listaAluno.get(i));

                // coloca -1 nas notas do aluno se n tiver notas
                if(!arrayNotasAluno.isEmpty()){
                    for(int j = 0 ; j < arrayNotasAluno.size() ; j++){
                        ArrayList<Double> listaNotas = new ArrayList<Double>();
                        listaNotas = arrayNotasAluno.get(j).getNotas();

                        Notas notasJ = arrayNotasAluno.get(j);
                        concat = notasJ.getAluno().getNome()+"  -  "+notasJ.getAluno().getMatricula()+"  -  ";
                        if(listaNotas.isEmpty())
                            concat2= "-l - -1 - -1 - "+notasJ.getStatus()+"\r\n";
                        else if(listaNotas.size() == 1)
                            concat2 = listaNotas.get(0)+" - -1 - -1 - "+notasJ.getStatus()+"\r\n";
                        else if(listaNotas.size() == 2)
                            concat2 = listaNotas.get(0)+" - "+listaNotas.get(1)+" - -1 - "+notasJ.getStatus()+"\r\n";
                        else if(listaNotas.size() > 2)
                            concat2 = listaNotas.get(0)+" - "+listaNotas.get(1)+" - "+listaNotas.get(2)+" - "+notasJ.getStatus()+"\r\n";

                        texto+="  "+concat+concat2+"\r\n";
                    }
                }
            }

            Gravar grav = new Gravar();
            grav.criaTxt(disciplinaImpressao.getNome(),texto);

            // -----    IMPRESSÃO    ------

            Calendar c = Calendar.getInstance();
            MessageFormat[] rodape = new MessageFormat[1];
            rodape[0] = new MessageFormat("SADAF UFPB -- "+c.get(c.DAY_OF_MONTH)+"/"+c.get(c.MONTH)+"/"+c.get(c.YEAR));
            MessageFormat[] cab    = new MessageFormat[3];
            PrinterJob job = PrinterJob.getPrinterJob();


            cab[0] = new MessageFormat("");
            cab[1] = new MessageFormat(cabecalho);
            cab[2] = new MessageFormat("");
            MyTablePrintable tabela = new MyTablePrintable(jTable3,JTable.PrintMode.FIT_WIDTH,  cab, rodape);
            job.setPrintable(tabela);
            try{
                job.print();
            }
            catch(PrinterException ex){
                Logger.getLogger(ExportException.class.getName()).log(Level.SEVERE, null, ex);
            }

            /*           
job.print();
} catch (PrinterException ex) {
Logger.getLogger(Export.class.getName()).log(Level.SEVERE, null, ex);   

            
            /*try{
                boolean press = jTable3.print(JTable.PrintMode.FIT_WIDTH ,cab,rodape);

                if (press) {
                    JOptionPane.showMessageDialog(null,"Impressão bem sucedida","Impressão",JOptionPane.INFORMATION_MESSAGE);

                } else {
                    JOptionPane.showMessageDialog(null,"Impressão Cancelada","Impressão",JOptionPane.ERROR_MESSAGE);
                }
            }           catch (PrinterException pe) {
                JOptionPane.showMessageDialog(null,"Impressão ERROR","Impressão",JOptionPane.ERROR_MESSAGE);
            } 
*/ 
        }//GEN-LAST:event_jButtonImprimirRelatorioNotasActionPerformed

        private void AtualizaSemestreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AtualizaSemestreActionPerformed
            for (int i = 0; i < jTable3.getRowCount(); i++) {
                        jTable3.setValueAt("", i, 0);
                        jTable3.setValueAt("", i, 1);
                        jTable3.setValueAt("", i ,2);
                        jTable3.setValueAt("", i ,3);
                        jTable3.setValueAt("", i ,4);
                        jTable3.setValueAt("", i ,5);
            }
                    
                    DisciplinaDAO disciplinaDAO = DisciplinaDAO.getInstance();
                    Disciplina disciplina = disciplinaDAO.ProcuraDisciplina(codigoDisciplina);
                    disciplinaImpressao = disciplina;      //VARIAVEL PARA TABELA DE IMPRESSÂO
                    NotasDAO notasDAO = NotasDAO.getInstance();
                    String semestreAtual = new String(jComboBox16.getSelectedItem()+"."+jComboBox7.getSelectedItem());
                    
                    ArrayList<Aluno> arrayList = notasDAO.montaListAlunosDeDisciplinaSemestre(disciplina,semestreAtual);
                    jLabel52.setText("Alunos matriculados em " + disciplina.getNome()+" Semestre "+semestreAtual);
                   if(!arrayList.isEmpty())
                    montarTabelaDeNotasDisciplina(arrayList,disciplina, jTable3, semestreAtual); //lista Aluno do semestre Atual
                    
                   
        }//GEN-LAST:event_AtualizaSemestreActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new InterfaceMain().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AtualizaSemestre;
    private javax.swing.ButtonGroup botoesExcluir;
    private javax.swing.ButtonGroup botoesListar;
    private javax.swing.JButton jButtonImprimirRelatorioNotas;
    private javax.swing.JButton jButtonSalvarRelatorioTxt;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox10;
    private javax.swing.JComboBox jComboBox11;
    private javax.swing.JComboBox jComboBox12;
    private javax.swing.JComboBox jComboBox13;
    private javax.swing.JComboBox jComboBox14;
    private javax.swing.JComboBox jComboBox15;
    private javax.swing.JComboBox jComboBox16;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JComboBox jComboBox5;
    private javax.swing.JComboBox jComboBox6;
    private javax.swing.JComboBox jComboBox7;
    private javax.swing.JComboBox jComboBox8;
    private javax.swing.JComboBox jComboBox9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelBotaoCadastrarAluno;
    private javax.swing.JLabel jLabelBotaoExcluir;
    private javax.swing.JLabel jLabelBotaoListar;
    private javax.swing.JLabel jLabelBotaoMatricular;
    private javax.swing.JLabel jLabelBotaoRegistrarNotas;
    private javax.swing.JLabel jLabelBotaoVisualizarAluno;
    private javax.swing.JLabel jLabelCadastrarAluno;
    private javax.swing.JLabel jLabelCadastrarDisciplina;
    private javax.swing.JLabel jLabelEstatisticas;
    private javax.swing.JLabel jLabelExcluir;
    private javax.swing.JLabel jLabelInfoAluno;
    private javax.swing.JLabel jLabelInfoSistema;
    private javax.swing.JLabel jLabelListar;
    private javax.swing.JLabel jLabelMatricular;
    private javax.swing.JLabel jLabelRegistrarNota;
    private javax.swing.JLayeredPane jLayeredPane3;
    private javax.swing.JPanel jPanelAlunosDeUmaDisciplina;
    private javax.swing.JPanel jPanelCadastrarAluno;
    private javax.swing.JPanel jPanelCadastrarDisciplina;
    private javax.swing.JPanel jPanelEstatisticas;
    private javax.swing.JPanel jPanelExcluir;
    private javax.swing.JPanel jPanelInfoAluno;
    private javax.swing.JPanel jPanelInfoSistema;
    private javax.swing.JPanel jPanelInicio;
    private javax.swing.JPanel jPanelListar;
    private javax.swing.JPanel jPanelMatricularAluno;
    private javax.swing.JPanel jPanelRegistrarNotas;
    private javax.swing.JPanel jPanelTodosAlunos;
    private javax.swing.JPanel jPanelVerAluno;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JRadioButton jRadioButton3;
    private javax.swing.JRadioButton jRadioButton4;
    private javax.swing.JRadioButton jRadioButton5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JLabel topo;
    // End of variables declaration//GEN-END:variables
}
